#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() 
{
    vector<int> v;
    int ret = 0;
    for (int i = 1; i <= 100000000; i++) {
        int t = i;
        while (t) {
            v.push_back(t % 10);
            t /= 10;
        }
        if (v.size() % 2 == 0) {
            int s1 = 0, s2 = 0;
            for (int i = 0; i < v.size() / 2; i++) s1 += v[i];
            for (int i = v.size() / 2; i < v.size(); i++) s2 += v[i];
            if (s1 == s2) ret++;
        }
        v.clear();
    }
    cout << ret << endl;
    return 0;
}

